package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CarCustomerInvoiceHeadMapper;
import com.ruoyi.system.domain.CarCustomerInvoiceHead;
import com.ruoyi.system.service.ICarCustomerInvoiceHeadService;

/**
 * 发票抬头Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-10
 */
@Service
public class CarCustomerInvoiceHeadServiceImpl implements ICarCustomerInvoiceHeadService 
{
    @Autowired
    private CarCustomerInvoiceHeadMapper carCustomerInvoiceHeadMapper;

    /**
     * 查询发票抬头
     * 
     * @param id 发票抬头主键
     * @return 发票抬头
     */
    @Override
    public CarCustomerInvoiceHead selectCarCustomerInvoiceHeadById(Long id)
    {
        return carCustomerInvoiceHeadMapper.selectCarCustomerInvoiceHeadById(id);
    }

    /**
     * 查询发票抬头列表
     * 
     * @param carCustomerInvoiceHead 发票抬头
     * @return 发票抬头
     */
    @Override
    public List<CarCustomerInvoiceHead> selectCarCustomerInvoiceHeadList(CarCustomerInvoiceHead carCustomerInvoiceHead)
    {
        return carCustomerInvoiceHeadMapper.selectCarCustomerInvoiceHeadList(carCustomerInvoiceHead);
    }

    /**
     * 新增发票抬头
     * 
     * @param carCustomerInvoiceHead 发票抬头
     * @return 结果
     */
    @Override
    public int insertCarCustomerInvoiceHead(CarCustomerInvoiceHead carCustomerInvoiceHead)
    {
        carCustomerInvoiceHead.setCreateTime(DateUtils.getNowDate());
        return carCustomerInvoiceHeadMapper.insertCarCustomerInvoiceHead(carCustomerInvoiceHead);
    }

    /**
     * 修改发票抬头
     * 
     * @param carCustomerInvoiceHead 发票抬头
     * @return 结果
     */
    @Override
    public int updateCarCustomerInvoiceHead(CarCustomerInvoiceHead carCustomerInvoiceHead)
    {
        carCustomerInvoiceHead.setUpdateTime(DateUtils.getNowDate());
        return carCustomerInvoiceHeadMapper.updateCarCustomerInvoiceHead(carCustomerInvoiceHead);
    }

    /**
     * 批量删除发票抬头
     * 
     * @param ids 需要删除的发票抬头主键
     * @return 结果
     */
    @Override
    public int deleteCarCustomerInvoiceHeadByIds(Long[] ids)
    {
        return carCustomerInvoiceHeadMapper.deleteCarCustomerInvoiceHeadByIds(ids);
    }

    /**
     * 删除发票抬头信息
     * 
     * @param id 发票抬头主键
     * @return 结果
     */
    @Override
    public int deleteCarCustomerInvoiceHeadById(Long id)
    {
        return carCustomerInvoiceHeadMapper.deleteCarCustomerInvoiceHeadById(id);
    }
}
